package com.myapp.ruyixing.http;

import org.json.JSONObject;

import com.myapp.ruyixing.model.CardBalance;

public class CardBalanceParser extends RYJSONParser {
	@Override
	public Object parse(JSONObject jsonObject) {
		if (getErrno(jsonObject) != NO_ERROR) {
			return null;
		}

		CardBalance balance = new CardBalance();

		JSONObject data = jsonObject.optJSONObject("data");
		balance.balance = data.optString("balance");
		balance.nickname = data.optString("nickname");
		return balance;
	}
}
